﻿@model OrderSettingsModel

<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-header">订单设置</div>
                <div class="layui-card-body">
                    <div class="layui-form" wid200 lay-filter="">
                        <div class="layui-form-item">
                            <u-label asp-for="IsReOrderAllowed" />
                            <div class="layui-input-inline">
                                <u-bool asp-for="IsReOrderAllowed" />
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <u-label asp-for="MinOrderSubtotalAmount" />
                            <div class="layui-input-inline">
                                <u-editor asp-for="MinOrderSubtotalAmount" />
                                <span asp-validation-for="MinOrderSubtotalAmount"></span> @Model.PrimaryStoreCurrencyCode
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <u-label asp-for="MinOrderTotalAmount" />
                            <div class="layui-input-inline">
                                <u-editor asp-for="MinOrderTotalAmount" />
                                <span asp-validation-for="MinOrderTotalAmount"></span> @Model.PrimaryStoreCurrencyCode
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <u-label asp-for="AnonymousCheckoutAllowed" />
                            <div class="layui-input-inline">
                                <u-bool asp-for="AnonymousCheckoutAllowed" />
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <u-label asp-for="TimeOffUnpaidOrderMinutes" />
                            <div class="layui-input-inline">
                                <u-editor asp-for="TimeOffUnpaidOrderMinutes" />
                                <span asp-validation-for="TimeOffUnpaidOrderMinutes"></span>
                            </div>
                        </div>
                        @if (Model.OrderIdent.HasValue)
                        {
                            <div class="layui-form-item">
                                <u-label asp-for="OrderIdent" />
                                <div class="layui-input-inline">
                                    <u-bool asp-for="OrderIdent" />
                                </div>
                            </div>
                        }
                        <div class="layui-form-item">
                            <u-label asp-for="AfterSalesEnabled" />
                            <div class="layui-input-inline">
                                <u-bool asp-for="AfterSalesEnabled" />
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <u-label asp-for="NumberOfDaysAfterSalesAvailable" />
                            <div class="layui-input-inline">
                                <u-editor asp-for="NumberOfDaysAfterSalesAvailable" />
                                <span asp-validation-for="NumberOfDaysAfterSalesAvailable"></span>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <u-label asp-for="AfterSalesReasonsParsed" />
                            <div class="layui-input-inline">
                                <u-editor asp-for="AfterSalesReasonsParsed" />
                                <span asp-validation-for="AfterSalesReasonsParsed"></span>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <u-label asp-for="AfterSalesActionsParsed" />
                            <div class="layui-input-inline">
                                <u-editor asp-for="AfterSalesActionsParsed" />
                                <span asp-validation-for="AfterSalesActionsParsed"></span>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <div class="layui-input-block">
                                <button class="layui-btn" lay-submit lay-filter="set_system_submit_btn">确认保存</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<script>
    layui.config({
        base: '../../../layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index', 'set'], function () {
        var $ = layui.$
            , form = layui.form
            ,active = { }
        form.on('submit(set_system_submit_btn)', function (obj) {
          var field = obj.field;
            $.post('@Url.Action("Order")', field, function (rep) {
                if (rep.success == 1) {
                    layer.msg('保存成功');
                }
            });
            return false;
    });
        $('.layui-btn.layuiadmin-btn-tags').on('click', function () {
            var type = $(this).data('type');
            active[type] ? active[type].call(this) : '';
        });

    });

</script>